<template>
	<uni-popup ref="popup" :isMaskClick="false" style="left: 20rpx;right:20rpx" background-color="transparent" @change="change" >
		<view class="popupView" >
			<view class="uni-share-content" style="display: flex;flex-direction: column;">
				<!-- <view class="sheet" v-for="(item,index) in list" :key="index" @click.stop="itemClick(item,index)">
					<text style="color: #000000;" :style="item.textStyle">{{item.text}}</text>
					<text v-if="item.subText" :style="{color:item.subTextColor}">{{item.subText}}</text>
				</view> -->
				<view class="sheet" v-for="(item,index) in list" :key="index" >
					<j-cell :title="item.name" @jftap="itemClick(item,index)"> 
						<view slot="icon">
							<image :src="item.url" class="icon"></image>
						</view>
						<view slot="tips" :style="{color:!item.enable?'#AEAEAE':item.isExpire?'#2CBDB8':'red',fontSize:'24rpx'}" >{{!item.enable?'未开通':item.isExpire?'使用中':'已过期'}}</view>
					</j-cell>
				</view>
			</view>
			<view class="uni-share-button-box" @click="close">
				<text style="color:#2CBDB8 ;" >取消</text>
			</view>
		</view>
	</uni-popup>
</template>

<script>
	export default {
		name: "j-sheet",
		props: {
			list: {
				type: Array,
				default () {
					return [];
				}
			},	
		},
		computed: {
			
		},
		methods: {
			open(){
				console.log('eeee,open');
				this.$refs.popup.open('bottom')
			},
			close(){
				this.$refs.popup.close();
				setTimeout(() => {
					uni.showTabBar()
				}, 200)
			},
			// 点击某一个item
			itemClick(item,index) {
				this.$emit('click', item);
			},
			change(){
				
			}
		}
	}
</script>

<style lang="scss" scoped>
	// @import "../../libs/css/style.components.scss";
	.uni-share-content {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: row;
		justify-content: center;
		// padding-top: 10px;
		background: white;
		border-radius: 10rpx;
	}
	.sheet{
		flex-direction: column;
		display: flex;
		padding: 0 10rpx
	}
	.uni-share-button-box {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: row;
		padding: 10px 15px;
		display: flex;
		justify-content: center;
		background: white;
		margin-top: 20rpx;
		border-radius: 10rpx;
	}
	.icon{
		width: 50rpx;
		height: 50rpx;
		margin-left: 20rpx;
	}

	.u-tips {
		font-size: 26rpx;
		text-align: center;
		padding: 34rpx 0;
		line-height: 1;
		color: #ff00ff;
	}

	.u-action-sheet-item {
		// @include vue-flex;;
		line-height: 1;
		justify-content: center;
		align-items: center;
		font-size: 32rpx;
		padding: 34rpx 0;
		flex-direction: column;
	}
	
	.u-action-sheet-item__subtext {
		font-size: 24rpx;
		color: #ff00ff;
		margin-top: 20rpx;
	}

	.u-gab {
		height: 12rpx;
		background-color: rgb(234, 234, 236);
	}

	.u-actionsheet-cancel {
		color: black;
	}
	
	.popupView{
			width:auto;
			// height: 30vh;
			overflow: hidden;
			border-radius: 5px; 
			padding: 5px;
			margin:10px;
			background: transparent;
		}
</style>
